<template>
  <div>
    <div class="home">
      <div class="item">
        <div class="num">6000</div>
        <div class="num">8000</div>
        <div class="num">9000</div>
        <div class="num">7000</div>
      </div>
    </div>
    <div class="content">
      <div class="num1">
        <div id="main" style="width: 600px;height:400px;"></div>
      </div>
      <div class="right-container">
        <div class="num2"></div>
        <div class="num3"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    tubiao(){
        // 基于准备好的dom，初始化echarts实例
      var myChart = this.$echarts.init(document.getElementById('main'));

      // 指定图表的配置项和数据
      var option = {
        title: {
          text: 'echarts数据可视化'
        },
        tooltip: {},
        legend: {
          data: ['销量']
        },
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: [
          {
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      };

      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    }
  },
  mounted() {
    this.tubiao()

  }
};
</script>

<style lang="less" scoped>
.home {
  margin: 20px;
  .item {
    display: flex;
    height: 100px;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    background: #fff;
    .num {
      margin: 0px 10px;
      color: #090909;
      flex: 1;
      height: 100px;
      width: 200px;
      background: rgba(115, 75, 246, 0.34);
      border-radius: 10px;
    }
  }
}

.content {
  margin: 20px;
  width: 97%;
  height: 500px;
  display: flex;
  border-radius: 10px;
  .num1 {
    height: 427px;
    width: 700px;
    border-radius: 10px;
    background: #fff;
  }
  .right-container {
    display: flex;
    flex-direction: column;
    margin-left: 20px;
    flex: 1;
    .num2 {
      height: 200px;
      border-radius: 10px;
      background: #ffffff;
    }
    .num3 {
      height: 200px;
      border-radius: 10px;
      background: #ffffff;
      margin-top: 20px;
    }
  }
}
</style>    